package com.atguigu.guli.service.trade.feign;

import com.atguigu.guli.common.base.result.R;
import com.atguigu.guli.service.base.dto.CourseDto;
import com.atguigu.guli.service.trade.feign.fallback.EduCourseFeignFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author Administrator
 * @desc 远程调用edu微服务
 * @create 2020/5/30
 */
@Service
@FeignClient(value = "service-edu", fallback = EduCourseFeignFallBack.class)
public interface EduCourseFeign {

    /**
     * 调用feign接口
     * @param courseId 课程id
     * @return 查询结果
     */
    @GetMapping(value = "/api/edu/course/inner/get-course-dto/{courseId}")
    CourseDto getCourseDtoById(@PathVariable("courseId") String courseId);

    /**
     * 调用feign接口
     * @param id 课程id
     * @return 处理结果
     */
    @GetMapping("/api/edu/course/inner/update-buy-count/{id}")
    R updateBuyCountById(@PathVariable("id") String id);

}
